


#include <iostream>
using namespace std;

string get_encrypted_text(string temp,int key)
{
    int i,j,temp_integer;
    string op="";
    string alphabets="abcdefghijklmnopqrstuvwxyz",capital_alphabets="ABCDEFGHIJKLMNOPQRSTUVWXYZ",numbers="0123456789";
        
        for(i=0;temp[i]!='\0';i++)
        {
           
            
            if((int)temp[i]<=122&&(int)temp[i]>=97)
	        {
                temp_integer=((int)temp[i]-97+key)%26;
                op+=alphabets[temp_integer];
            }
           
            else if((int)temp[i]>=65&&(int)temp[i]<=91)
	        {
                temp_integer=((int)temp[i]-65+key)%26;
                op+=capital_alphabets[temp_integer];
            }
            
            else if((int)temp[i]>=48&&(int)temp[i]<=57)
            {
                temp_integer=((int)temp[i]-48+key)%10;
                op+=numbers[temp_integer];
            }
            
            else if((int)temp[i]==32)
                op+=" ";
            
            else
                op+=(char)((int)(temp[i])+key);
        }
        

	return op;
        
        
}

int main() {
    string op;
	int key;
    char ip[100];

    
    cout<<"Enter the String to be encrypted\n";
    
    cin.getline(ip,sizeof(ip));
    
    cout<<"\nEnter the key\n";
    
    cin>>key;
	
    op=get_encrypted_text(ip,key);
    
    cout<<"\nEncrypted String is "<<op<<endl<<"-----------------------------------------------------";
   
    for(int j=0;j<26;j++)
    {
        op=get_encrypted_text (op,1);
        cout<<"\nEncrypted combinations are "<<op<<endl;
    
    }
    
    return 0;
}


/*
 #include <iostream>
 #include <ctime>
 
 using namespace std;
 
 int main( )
 {
 // current date/time based on current system
 time_t now = time(0);
 
 // convert now to string form
 char* dt = ctime(&now);
 
 cout << "The local date and time is: " << dt << endl;
 
 // convert now to tm struct for UTC
 tm *gmtm = gmtime(&now);
 dt = asctime(gmtm);
 cout << "The UTC date and time is:"<< dt << endl;
 }
 */
